﻿using UnityEngine;
using System.Collections;

public class CubeController : MonoBehaviour {

	Vector3 newPos;
	float speed = 2.0f;
	float distance = 0.3f;
	public Vector3 posA = new Vector3(2,1,3);
	public Vector3 posB = new Vector3(2,1,-3);

	void Start(){
		transform.renderer.material.color = Color.gray;
	}

	void Awake(){
		newPos = transform.position;
	}
	
	// Update is called once per frame
	void Update () {
		moveCube();
	}

	void moveCube(){
		transform.position = Vector3.Lerp(transform.position,newPos,Time.deltaTime * speed);
	}
}